import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Admin
 * Date: 2022-04-23
 * Time: 13:25
 */
/*final class Animal implements Cloneable{
    public String name;
    public int age;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}*/
public class TestDemo {
    private String userName = "admin";
    private String password = "123456";

    public  void loginInfo(String userName, String password) throws UserErrorExecption ,AdminErrorExecption {
        if (!this.userName.equals(userName)) {
           // System.out.println("用户名错误");
            throw new UserErrorExecption("出现一个用户异常错误:");
        }

        if (!this.password.equals(password)) {
            //System.out.println("密码错误");
            throw new AdminErrorExecption("出现一个密码异常错误:");
        }

        System.out.println("登陆成功");
    }

    public static void main(String[] args) {
        char[] ch = new char[26];
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        char[] ret = str.toCharArray();
        for(int i = 0;i < ret.length;i++) {
            ch[ret[i]-'a'] = ret[i];
        }
        for(int j = 0; j < ret.length;j++) {
            if(ret[j] == ch[ret[j]-'a'] ) {
                System.out.print(ch[j]);
            }
        }
    }


    public static void main2(String[] args) {
        try {
            TestDemo testdemo = new TestDemo();
            testdemo.loginInfo("admin", "1234568");
        } catch (UserErrorExecption e) {
            //System.out.println("这是一个用户名异常");
            e.printStackTrace();
        } catch (AdminErrorExecption a) {
            //System.out.println("这是一个密码错误异常");
            a.printStackTrace();
        }
    }

}

/*
public class TestDemo {
    public static void main(String[] args) throws CloneNotSupportedException {
        int[] ch = {1,2,3,4,5,6,7,8};
        Animal animal =new Animal();
        Animal animal1 = (Animal) animal.clone();
        System.out.println(Arrays.toString(ch));
    }
}*/
